<html>
<head>
  <title>楼盘管理</title>
  <meta name="layout" content="common_header"/>
  <link rel="stylesheet" type="text/css" href="${resource(dir: 'css', file: 'jquery.validate.css', absolute: true)}"/>
  <link rel="stylesheet" type="text/css" href="${resource(dir: 'css', file: 'autocomplete.css', absolute: true)}"/>
  <script type="text/javascript">jQuery.noConflict()</script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.form.min.js')}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.metadata.pack.js')}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'thickbox.min.js')}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.validate.min.js', absolute: true)}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.blockUI.min.js', absolute: true)}"></script>

  <script type="text/javascript" src="${resource(dir: 'js/prototype', file: 'prototype-1.4.0.js')}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/prototype', file: 'autocomplete.js')}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'autocomplete.custom.js')}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'jquery.validate.custom.js')}"></script>
  <script type="text/javascript" src="${resource(dir: 'js/jquery', file: 'common.custom.js')}"></script>


  <script type="text/javascript">
    jQuery(document).ready(function() {
      jQuery("#submitForm").validate({
        errorPlacement: function(error, element) {
          error.appendTo(element.parent("td"));
        },
        submitHandler: function(form) {
          jQuery.blockUI();
          jQuery(form).ajaxSubmit({
            success: function(response) {
              jQuery.unblockUI();
            }
          });
        }
      });
      bindSave();
      new CAPXOUS.AutoComplete("sector_NAME", function() {
        var dicName = "SECTOR"
        if (jQuery("#type").val() == '12') {
          dicName = "CIRCLE"
        }
        var parent = jQuery("#area").val();
        return "${createLink(controller:'dictionary',action:'showList',absolute:true)}?dicName=" + dicName + "&parent=" + parent + "&t=" + (+new Date)
      }, {
        formName:'submitForm',
        formTarget:['sector'],
        javaTarget:['dm'],
        javaSource:['mc'],
        width:160
      });

    });

    function approveEstate(id, flag) {
      jQuery("#id").val(id)
      jQuery("#flag").val(flag)
      jQuery("#submitForm").ajaxSubmit({
        success: function(response) {
          if (response == "1") {
            jQuery("#approveFlag_" + id).html(flag == "1" ? "通过" : "不通过")
          } else {
            alert("审批出错")
          }
        }
      });
    }

  </script>
</head>
<body>
<div id="man_zone">
  <form id="submitForm" name="submitForm" action="${createLink(controller: "scaffold", action: 'save', absolute: true)}" method="post">
    <input type="hidden" name="property" value="${bo?.class.simpleName}"/>
    <input type="hidden" name="id" value="${bo?.id}"/>
    <input type="hidden" name="view" value="${forward}"/>
    <table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" class="table_style">
      <tr>
        <td align="center" colspan="4" class="center_title_1">
          <b>楼盘竞标</b>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">名称</td>
        <td width="30%" class="fillin">
          <input type="text" id="name" name="name" value="${bo?.name}" class="{byteMaxLength:20}"/>
        </td>
        <td width="20%" class="left_title_1">拼音首字母</td>
        <td width="30%" class="fillin">
          <input type="text" id="pinyin" name="pinyin" value="${bo?.pinyin}" class="{byteMaxLength:20}"/>
        </td>
      </tr>
      <tr>
        <td class="left_title_1">类型</td>
        <td class="fillin">
          <g:radioGroup name="type" labels="['住宅','商用']" value="${bo?.type}" values="[10,20]">
            ${it.label} ${it.radio} &nbsp;
          </g:radioGroup>

        </td>
        <td class="left_title_1">区域</td>
        <td class="fillin">
          <input type="text" id="area_NAME" name="area_NAME" value="${bo?.areaName}" dicName="SH_DISTRICT" class="input_dict {notEmpty:'板块/商圈'}" tips="请选择板块"/>
          <input type="hidden" id="area" name="area" value="${bo?.area}"/>

        </td>
      </tr>
      <tr>
        <td class="left_title_1">板块/商圈</td>
        <td class="fillin">

          <input type="text" id="sector_NAME" name="sector_NAME" value="${bo?.sectorName}" class="input_dict {notEmpty:'板块/商圈'}" tips="请选择板块"/>
          <input type="hidden" id="sector" name="sector" value="${bo?.sector}"/>
        </td>

      </tr>
      <tr>
        <td class="left_title_1">地址</td>
        <td class="fillin" colspan="3">
          <input type="text" id="address" name="address" value="${bo?.address}" size="100" class="{byteMaxLength:255}"/>
        </td>
      </tr>

      <tr>
        <td class="left_title_1">显示标记位</td>
        <td class="fillin">
          <input type="hidden" id="showFlag" name="showFlag" value="${bo?.showFlag}"/>
          <g:radioGroup name="showFlag" labels="['显示','不显示']" value="${bo?.showFlag}" values="[1,0]">
            ${it.label} ${it.radio} &nbsp;
          </g:radioGroup>

        </td>
        <td class="left_title_1">审批通过标记</td>
        <td class="fillin">
          <input type="hidden" id="approveFlag" name="approveFlag" value="${bo?.approveFlag}"/>

          <g:if test="${bo?.approveFlag=='0'}">
            审核中

          </g:if>
          <g:if test="${bo?.approveFlag=='1'}">
            通过

          </g:if>
          <g:if test="${bo?.approveFlag=='2'}">
            不通过

          </g:if>

          <g:if test="${bo.approveFlag=='0'}">操作：<a href="javaScript:approveEstate('${bo.id}','1')">通过</a>|<a href="javaScript:approveEstate('${bo.id}','2')">不通过</a></g:if>

        </td>
      </tr>

      <tr>
        <td width="20%" class="left_title_1">物业类型</td>
        <td width="30%" class="fillin">
          <input type="text" id="propertyType" name="propertyType" value="${bo?.propertyType}"/>
        </td>
        <td width="20%" class="left_title_1">建筑类型</td>
        <td width="30%" class="fillin">
          <input type="text" id="buildingType" name="buildingType" value="${bo?.buildingType}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">物业公司</td>
        <td width="30%" class="fillin">
          <input type="text" id="propertyCompany" name="propertyCompany" value="${bo?.propertyCompany}"/>
        </td>
        <td width="20%" class="left_title_1">管理费</td>
        <td width="30%" class="fillin">
          <input type="text" id="managetmentFee" name="managetmentFee" value="${bo?.managetmentFee}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">开发商</td>
        <td width="30%" class="fillin">
          <input type="text" id="developer" name="developer" value="${bo?.developer}"/>
        </td>
        <td width="20%" class="left_title_1">停车位</td>
        <td width="30%" class="fillin">
          <input type="text" id="parking" name="parking" value="${bo?.parking}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">建筑面积</td>
        <td width="30%" class="fillin">
          <input type="text" id="buildingSqm" name="buildingSqm" value="${bo?.buildingSqm}"/>
        </td>
        
      </tr>
      <tr>
        <td width="20%" class="left_title_1">绿化率</td>
        <td width="30%" class="fillin">
          <input type="text" id="greeningRatio" name="greeningRatio" value="${bo?.greeningRatio}"/>
        </td>
        <td width="20%" class="left_title_1">容积率</td>
        <td width="30%" class="fillin">
          <input type="text" id="volumeRatio" name="volumeRatio" value="${bo?.volumeRatio}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">竣工时间</td>
        <td width="30%" class="fillin" colspan="3">
          <input name="completionDate" precision="day" value="${bo?.completionDate}"/>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">楼盘简介</td>
        <td colspan="3">
          <textarea id="summary" name="summary" style="width:300px;height:150px">${bo?.summary}</textarea>
        </td>
      </tr>
      <tr>
        <td width="20%" class="left_title_1">周边配套</td>
        <td colspan="3">
          <textarea id="surrounding" name="surrounding" style="width:300px;height:150px">${bo?.surrounding}</textarea>
        </td>
      </tr>

      <tr>
        <td width="20%" class="left_title_1">小区配套</td>
        <td colspan="3">
          <textarea id="supportingService" name="supportingService" style="width:300px;height:150px">${bo?.supportingService}</textarea>
        </td>
      </tr>
      <tr>
        <td align="center" colspan="2">
          <a id="doSave" href="javaScript:void(0)"><img src="${resource(dir: '/images/admin_ui/', file: 'save1.gif', absolute: true)}" alt="保存"/></a>
        </td>

        <td></td>

      </tr>

    </table>

  </form>
</div>
</body>
</html>
